home *** CD-ROM | disk | FTP | other *** search
/ BBS in a Box 3 / BBS in a box - Trilogy III.iso / Files / System7 tools / Frontier / Frontier SDK 2.1 / Toolkits / IAC Tools / iactable.c < prev    next >
Encoding:
C/C++ Source or Header  |  1993-06-09  |  1.4 KB  |  85 lines  |  [TEXT/KAHL]

  1.  
  2. /*© Copyright 1988-1993 UserLand Software, Inc.  All Rights Reserved.*/
  3.  
  4. #include "iacinternal.h"
  5.  
  6.  
  7. #define typeTable 'tabl'
  8.  
  9.  
  10. Boolean IACpushtableparam (Handle val, OSType keyword) {
  11.  
  12.     return (IACpushbinaryparam (val, typeTable, keyword));
  13.     } /*IACpushtableparam*/
  14.  
  15.  
  16. Boolean IACreturntable (Handle x) {
  17.  
  18.     return (IACreturnbinary (x, typeTable));
  19.     } /*IACreturntable*/
  20.     
  21.     
  22. Boolean IACgettableparam (OSType keyword, Handle *hbinary) {
  23.     
  24.     OSType binarytype;
  25.     
  26.     if (!IACgetbinaryparam (keyword, hbinary, &binarytype))
  27.         return (false);
  28.     
  29.     if (binarytype != typeTable) {
  30.         
  31.         DisposHandle (*hbinary);
  32.         
  33.         *hbinary = nil;
  34.         
  35.         IACparamerror (1, "\ptable", keyword);
  36.         
  37.         return (false);
  38.         }
  39.     
  40.     return (true);
  41.     } /*IACgettableparam*/
  42.     
  43.  
  44. Boolean IACgettableitem (AEDescList *list, long n, Handle *val) {
  45.     
  46.     register OSErr ec;
  47.     AEDesc desc;
  48.     DescType key;
  49.     Size actualSize;
  50.     
  51.     if ((*list).descriptorType != typeAEList) {
  52.     
  53.         ec = AEGetKeyDesc (list, n, typeTable, &desc);
  54.         
  55.         if (ec != errAEDescNotFound)
  56.             goto done;
  57.         }
  58.  
  59.     ec = AEGetNthDesc (list, n, typeTable, &key, &desc);
  60.     
  61.     done:
  62.     
  63.     IACglobals.errorcode = ec;
  64.     
  65.     if (ec == noErr) {
  66.     
  67.         *val = desc.dataHandle;
  68.         
  69.         return (true);
  70.         }
  71.     else {
  72.         *val = NULL;
  73.         
  74.         return (false);
  75.         }
  76.     } /*IACgettableitem*/
  77.     
  78.  
  79. Boolean IACpushtableitem (AEDescList *list, Handle val, long n) {
  80.     
  81.     return (IACpushbinaryitem (list, val, typeTable, n));
  82.     } /*IACpushtableitem*/
  83.  
  84.  
  85.